#include <stdio.h> 
#include <utility> 

template<typename T>
class singleton {
public:
    singleton(const singleton<T>&) = delete;
    singleton<T> operator= (const singleton<T>&) = delete;
    template<typename... Args>
    static singleton<T> *get_instance(Args&&... args) {
        if (instance == nullptr)
            instance = new singleton<T>(std::forward<Args>(args)...);

        return instance;
    }

    static void destroy() {
        if (instance) {
            delete instance;
            instance = nullptr;
        }
    }
private:
    singleton() {}

private:
    static T * instance;
};

template<typename T>
T * singleton<T>::instance = nullptr;

int main(int argc, char **argv) {
    
    return 0;
}
